<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/3/28
 * Time: 10:43
 */
namespace common\sources\write\taskcommodkeywords;

use common\models\craftsman\TaskCommodKeywords;
use Yii;

class TaskCommodKeywordAccess implements ITaskCommodKeywordAccess
{
    public function addTaskCommodKeyword($data)
    {
        $connect  = Yii::$app->db;
        $queryBuilder = $connect->queryBuilder;
        $sql = $queryBuilder->batchInsert(TaskCommodKeywords::tableName(),['bus_id','task_commod_id','word','num','create_time'],$data);
       return $connect->createCommand($sql)->execute();
    }

    public function delTaskCommodKeyword($task_commod_id)
    {
        return TaskCommodKeywords::deleteAll(['task_commod_id' => $task_commod_id]);
    }
}